package cn.submarine;

import javax.swing.*;

public class BattleShip extends SeaObject{
    private int life;

    public BattleShip(){
        super(66,26,270,124,8);
        life = 5;
    }

    public void move () {
    }

    @Override
    public ImageIcon getImage() {
        return Images.battleship;
    }

    public Bomb shootBomb(){//返回深水炸弹
        return new Bomb(this.x,this.y);
    }

    //战舰左移
    public void moveLeft(){
        x -= speed;
    }

    //战舰右移
    public void moveRight(){
        x += speed;
    }

    public void addLife(int num){//战舰增加命
        life += num;
    }

    public int getLife(){
        return life;//返回命数
    }

    public void subtractLife(){
        life--;//战舰减命
    }
}
